package com.burt.webflux;

import static org.springframework.web.reactive.function.server.RequestPredicates.POST;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;

/**
 * WebFluxConfiguration
 * 
 * @author luowei1
 * @date 2018/7/4 17:42
 */
@Configuration
public class WebFluxConfiguration {

    @Bean
    public RouterFunction<ServerResponse> savePerson(PersonHandler personHandler) {
        return route(POST("/web/flux/person/save"), personHandler::save);
    }
}
